using Microsoft.Office.Project.Server.Events;
using Microsoft.Office.Project.Server.Library;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using Microsoft.SharePoint;
using Microsoft.Office.Project.Server.Schema;



namespace PSIEventLogger
{
    #region Admin Events
    public class AdminEventHandler : AdminEventReceiver
    {
        private const string CLASS_NAME = "AdminEventHandler";

        public override void OnAdSyncERPSynchronized(PSContextInfo contextInfo, AdSyncERPSynchronizedEventArgs e)
        {
            base.OnAdSyncERPSynchronized(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnAdSyncERPSynchronized");
        }

        public override void OnAdSyncERPSynchronizing(PSContextInfo contextInfo, AdSyncERPSynchronizingEventArgs e)
        {
            base.OnAdSyncERPSynchronizing(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnAdSyncERPSynchronizing");
        }

        public override void OnAdSyncGroupsSynchronized(PSContextInfo contextInfo, AdSyncGroupsSynchronizedEventArgs e)
        {
            base.OnAdSyncGroupsSynchronized(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnAdSyncGroupsSynchronized");
        }

        public override void OnAdSyncGroupsSynchronizing(PSContextInfo contextInfo, AdSyncGroupsSynchronizingEventArgs e)
        {
            base.OnAdSyncGroupsSynchronizing(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnAdSyncGroupsSynchronizing");
        }

        public override void OnAdSyncGroupSynchronized(PSContextInfo contextInfo, AdSyncGroupSynchronizedEventArgs e)
        {
            base.OnAdSyncGroupSynchronized(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnAdSyncGroupSynchronized");
        }

        public override void OnAdSyncGroupSynchronizing(PSContextInfo contextInfo, AdSyncGroupSynchronizingEventArgs e)
        {
            base.OnAdSyncGroupSynchronizing(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnAdSyncGroupSynchronizing");
        }

        public override void OnLineClassUpdated(PSContextInfo contextInfo, LineClassPostUpdateEventArgs e)
        {
            base.OnLineClassUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnLineClassUpdated");
        }

        public override void OnLineClassUpdating(PSContextInfo contextInfo, LineClassPreUpdateEventArgs e)
        {
            base.OnLineClassUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnLineClassUpdating");
        }

        public override void OnReportingPeriodUpdated(PSContextInfo contextInfo, ReportingPeriodPostUpdateEventArgs e)
        {
            base.OnReportingPeriodUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnReportingPeriodUpdated");
        }

        public override void OnReportingPeriodUpdating(PSContextInfo contextInfo, ReportingPeriodPreUpdateEventArgs e)
        {
            base.OnReportingPeriodUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnReportingPeriodUpdating");
        }

        public override void OnStatusReportsDeleted(PSContextInfo contextInfo, StatusReportPostDeleteEventArgs e)
        {
            base.OnStatusReportsDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnStatusReportsDeleted");
        }

        public override void OnStatusReportsDeleting(PSContextInfo contextInfo, StatusReportPreDeleteEventArgs e)
        {
            base.OnStatusReportsDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnStatusReportsDeleting");
        }
    }
    #endregion

    #region Calendar Events
    public class CalendarEventHandler : CalendarEventReceiver
    {
        private const string CLASS_NAME = "CalendarEventHandler";

        public override void OnChanged(PSContextInfo contextInfo, CalendarPostEventArgs e)
        {
            base.OnChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnChanged");
        }

        public override void OnChanging(PSContextInfo contextInfo, CalendarPreEventArgs e)
        {
            base.OnChanging(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnChanging");
        }

        public override void OnCheckedIn(PSContextInfo contextInfo, CalendarCheckInPostEventArgs e)
        {
            base.OnCheckedIn(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckedIn");
        }

        public override void OnCheckedOut(PSContextInfo contextInfo, CalendarCheckOutPostEventArgs e)
        {
            base.OnCheckedOut(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckedOut");
        }

        public override void OnCheckingIn(PSContextInfo contextInfo, CalendarCheckInPreEventArgs e)
        {
            base.OnCheckingIn(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckingIn");
        }

        public override void OnCheckingOut(PSContextInfo contextInfo, CalendarCheckOutPreEventArgs e)
        {
            base.OnCheckingOut(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckingOut");
        }

        public override void OnCreated(PSContextInfo contextInfo, CalendarPostEventArgs e)
        {
            base.OnCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreated");
        }

        public override void OnCreating(PSContextInfo contextInfo, CalendarPreEventArgs e)
        {
            base.OnCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreating");
        }

        public override void OnDeleted(PSContextInfo contextInfo, CalendarDeletePostEventArgs e)
        {
            base.OnDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleted");
        }

        public override void OnDeleting(PSContextInfo contextInfo, CalendarDeletePreEventArgs e)
        {
            base.OnDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleting");
        }

    }
    #endregion

    #region Cube Admin Events
    public class CubeAdminEventHandler : CubeAdminEventReceiver
    {
        private const string CLASS_NAME = "CubeAdminEventHandler";

        public override void OnCubeProcessed(PSContextInfo contextInfo, CubeAdminPostCubeProcessEventArgs e)
        {
            base.OnCubeProcessed(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCubeProcessed");
        }

        public override void OnCubeBuilding(PSContextInfo contextInfo, CubeAdminPreCubeBuildEventArgs e)
        {
            base.OnCubeBuilding(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCubeBuilding");
        }

        public override void OnCubeBuilt(PSContextInfo contextInfo, CubeAdminPostCubeBuildEventArgs e)
        {
            base.OnCubeBuilt(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCubeBuilt");
        }
    }
    #endregion

    #region Custom Fields Events
    public class CustomFieldsEventHandler : CustomFieldsEventReceiver
    {
        private const string CLASS_NAME = "CustomFieldsEventHandler";

        public override void OnCheckedIn(PSContextInfo contextInfo, CustomFieldsCheckInPostEventArgs e)
        {
            base.OnCheckedIn(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckedIn");
        }

        public override void OnCheckedOut(PSContextInfo contextInfo, CustomFieldsCheckOutPostEventArgs e)
        {
            base.OnCheckedOut(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckedOut");
        }

        public override void OnCheckingIn(PSContextInfo contextInfo, CustomFieldsCheckInPreEventArgs e)
        {
            base.OnCheckingIn(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckingIn");
        }

        public override void OnCheckingOut(PSContextInfo contextInfo, CustomFieldsCheckOutPreEventArgs e)
        {
            base.OnCheckingOut(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckingOut");
        }

        public override void OnCreated(PSContextInfo contextInfo, CustomFieldsPostEventArgs e)
        {
            base.OnCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreated");
        }

        public override void OnCreating(PSContextInfo contextInfo, CustomFieldsPreEventArgs e)
        {
            base.OnCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreating");
        }

        public override void OnDeleted(PSContextInfo contextInfo, CustomFieldsDeletePostEventArgs e)
        {
            base.OnDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleted");
        }

        public override void OnDeleting(PSContextInfo contextInfo, CustomFieldsDeletePreEventArgs e)
        {
            base.OnDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleting");
        }

        public override void OnUpdated(PSContextInfo contextInfo, CustomFieldsPostEventArgs e)
        {
            base.OnUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnUpdated");
        }

        public override void OnUpdating(PSContextInfo contextInfo, CustomFieldsPreEventArgs e)
        {
            base.OnUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnUpdating");
        }
    }
    #endregion

    #region Lookup Table Events
    public class LookupTableEventHandler : LookupTableEventReceiver
    {
        private const string CLASS_NAME = "LookupTableEventHandler";

        public override void OnCheckedIn(PSContextInfo contextInfo, LookupTableCheckInPostEventArgs e)
        {
            base.OnCheckedIn(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckedIn");
        }

        public override void OnCheckedOut(PSContextInfo contextInfo, LookupTableCheckOutPostEventArgs e)
        {
            base.OnCheckedOut(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckedOut");
        }

        public override void OnCheckingIn(PSContextInfo contextInfo, LookupTableCheckInPreEventArgs e)
        {
            base.OnCheckingIn(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckingIn");
        }

        public override void OnCheckingOut(PSContextInfo contextInfo, LookupTableCheckOutPreEventArgs e)
        {
            base.OnCheckingOut(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckingOut");
        }

        public override void OnCreated(PSContextInfo contextInfo, LookupTablePostEventArgs e)
        {
            base.OnCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreated");
        }

        public override void OnCreating(PSContextInfo contextInfo, LookupTablePreEventArgs e)
        {
            base.OnCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreating");
        }

        public override void OnDeleted(PSContextInfo contextInfo, LookupTableDeletePostEventArgs e)
        {
            base.OnDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleted");
        }

        public override void OnDeleting(PSContextInfo contextInfo, LookupTableDeletePreEventArgs e)
        {
            base.OnDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleting");
        }

        public override void OnUpdated(PSContextInfo contextInfo, LookupTablePostEventArgs e)
        {
            base.OnUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnUpdated");
        }

        public override void OnUpdating(PSContextInfo contextInfo, LookupTablePreEventArgs e)
        {
            base.OnUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnUpdating");
        }
    }
    #endregion

    #region Notifications Events
    public class NotificationsEventHandler : NotificationsEventReceiver
    {
        private const string CLASS_NAME = "NotificationsEventHandler";

        public override void OnSending(PSContextInfo contextInfo, NotificationsPreSendEventArgs e)
        {
            base.OnSending(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnSending");
        }

        public override void OnSent(PSContextInfo contextInfo, NotificationsPostSendEventArgs e)
        {
            base.OnSent(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnSent");
        }
    }
    #endregion

    #region Reporting Events
    public class ReportingEventHandler : ReportingEventReceiver
    {
        private const string CLASS_NAME = "ReportingEventHandler";

        public override void OnCustomFieldChanged(PSContextInfo contextInfo, ReportingPostCustomFieldChangedEventArgs e)
        {
            base.OnCustomFieldChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCustomFieldChanged");
        }

        public override void OnCustomFieldCreated(PSContextInfo contextInfo, ReportingPostCustomFieldCreatedEventArgs e)
        {
            base.OnCustomFieldCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCustomFieldCreated");
        }

        public override void OnCustomFieldDeleted(PSContextInfo contextInfo, ReportingPostCustomFieldDeletedEventArgs e)
        {
            base.OnCustomFieldDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCustomFieldDeleted");
        }

        public override void OnFiscalPeriodChanged(PSContextInfo contextInfo, ReportingPostFiscalPeriodChangedEventArgs e)
        {
            base.OnFiscalPeriodChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnFiscalPeriodChanged");
        }

        public override void OnFiscalPeriodDeleted(PSContextInfo contextInfo, ReportingPostFiscalPeriodDeletedEventArgs e)
        {
            base.OnFiscalPeriodDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnFiscalPeriodDeleted");
        }

        public override void OnLookupTableChanged(PSContextInfo contextInfo, ReportingPostLookupTableChangedEventArgs e)
        {
            base.OnLookupTableChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnLookupTableChanged");
        }

        public override void OnLookupTableCreated(PSContextInfo contextInfo, ReportingPostLookupTableCreatedEventArgs e)
        {
            base.OnLookupTableCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnLookupTableCreated");
        }

        public override void OnLookupTableDeleted(PSContextInfo contextInfo, ReportingPostLookupTableDeletedEventArgs e)
        {
            base.OnLookupTableDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnLookupTableDeleted");
        }

        public override void OnProjectChanged(PSContextInfo contextInfo, ReportingPostProjectChangedEventArgs e)
        {
            base.OnProjectChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnProjectChanged");
        }

        public override void OnProjectCreated(PSContextInfo contextInfo, ReportingPostProjectCreatedEventArgs e)
        {
            base.OnProjectCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnProjectCreated");
        }

        public override void OnProjectDeleted(PSContextInfo contextInfo, ReportingPostProjectDeletedEventArgs e)
        {
            base.OnProjectDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnProjectDeleted");
        }

        public override void OnProjectWorkspaceChanged(PSContextInfo contextInfo, ReportingPostProjectWorkspaceChangedEventArgs e)
        {
            base.OnProjectWorkspaceChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnProjectWorkspaceChanged");
        }

        public override void OnProjectWorkspaceCreated(PSContextInfo contextInfo, ReportingPostProjectWorkspaceCreatedEventArgs e)
        {
            base.OnProjectWorkspaceCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnProjectWorkspaceCreated");
        }

        public override void OnProjectWorkspaceDeleted(PSContextInfo contextInfo, ReportingPostProjectWorkspaceDeletedEventArgs e)
        {
            base.OnProjectWorkspaceDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnProjectWorkspaceDeleted");
        }

        public override void OnResourceCapacitiesChanged(PSContextInfo contextInfo, ReportingPostResourceCapacitiesChangedEventArgs e)
        {
            base.OnResourceCapacitiesChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnResourceCapacitiesChanged");
        }

        public override void OnResourceCapacityTimeRangeChanged(PSContextInfo contextInfo, ReportingPostResourceCapacityTimeRangeChangedEventArgs e)
        {
            base.OnResourceCapacityTimeRangeChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnResourceCapacityTimeRangeChanged");
        }

        public override void OnResourceChanged(PSContextInfo contextInfo, ReportingPostResourceChangedEventArgs e)
        {
            base.OnResourceChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnResourceChanged");
        }

        public override void OnResourceCreated(PSContextInfo contextInfo, ReportingPostResourceCreatedEventArgs e)
        {
            base.OnResourceCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnResourceCreated");
        }

        public override void OnResourceDeleted(PSContextInfo contextInfo, ReportingPostResourceDeletedEventArgs e)
        {
            base.OnResourceDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnResourceDeleted");
        }

        public override void OnTimesheetAdjusted(PSContextInfo contextInfo, ReportingPostTimesheetAdjustedEventArgs e)
        {
            base.OnTimesheetAdjusted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTimesheetAdjusted");
        }

        public override void OnTimesheetDeleted(PSContextInfo contextInfo, ReportingPostTimesheetDeletedEventArgs e)
        {
            base.OnTimesheetDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTimesheetDeleted");
        }

        public override void OnTimesheetPeriodChanged(PSContextInfo contextInfo, ReportingPostTimesheetPeriodChangedEventArgs e)
        {
            base.OnTimesheetPeriodChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTimesheetPeriodChanged");
        }

        public override void OnTimesheetPeriodCreated(PSContextInfo contextInfo, ReportingPostTimesheetPeriodCreatedEventArgs e)
        {
            base.OnTimesheetPeriodCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTimesheetPeriodCreated");
        }

        public override void OnTimesheetPeriodDeleted(PSContextInfo contextInfo, ReportingPostTimesheetPeriodDeletedEventArgs e)
        {
            base.OnTimesheetPeriodDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTimesheetPeriodDeleted");
        }

        public override void OnTimesheetSaved(PSContextInfo contextInfo, ReportingPostTimesheetSavedEventArgs e)
        {
            base.OnTimesheetSaved(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTimesheetSaved");
        }

        public override void OnTimesheetStatusChanged(PSContextInfo contextInfo, ReportingPostTimesheetStatusChangedEventArgs e)
        {
            base.OnTimesheetStatusChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTimesheetStatusChanged");
        }

        public override void OnUserViewChanged(PSContextInfo contextInfo, ReportingPostUserViewChangedEventArgs e)
        {
            base.OnUserViewChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnUserViewChanged");
        }
    }
    #endregion

    #region Resource Events
    public class ResourceEventHandler : ResourceEventReceiver
    {
        private const string CLASS_NAME = "ResourceEventHandler";

        public override void OnActivated(PSContextInfo contextInfo, ResourceActivatePostEventArgs e)
        {
            base.OnActivated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnActivated");
        }

        public override void OnActivating(PSContextInfo contextInfo, ResourceActivatePreEventArgs e)
        {
            base.OnActivating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnActivating");
        }

        public override void OnChanged(PSContextInfo contextInfo, ResourceUpdatePostEventArgs e)
        {
            base.OnChanged(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnChanged");
        }

        public override void OnChanging(PSContextInfo contextInfo, ResourceUpdatePreEventArgs e)
        {
            base.OnChanging(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnChanging");
        }


        public override void OnCheckedIn(PSContextInfo contextInfo, ResourceCheckInPostEventArgs e)
        {
            base.OnCheckedIn(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckedIn");
        }

        public override void OnCheckedOut(PSContextInfo contextInfo, ResourceCheckOutPostEventArgs e)
        {
            base.OnCheckedOut(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckedOut");
        }

        public override void OnCheckingIn(PSContextInfo contextInfo, ResourceCheckInPreEventArgs e)
        {
            base.OnCheckingIn(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckingIn");
        }

        public override void OnCheckingOut(PSContextInfo contextInfo, ResourceCheckOutPreEventArgs e)
        {
            base.OnCheckingOut(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckingOut");
        }

        public override void OnCreated(PSContextInfo contextInfo, ResourceCreatePostEventArgs e)
        {
            base.OnCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreated");
        }

        public override void OnCreating(PSContextInfo contextInfo, ResourceCreatePreEventArgs e)
        {
            base.OnCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreating");
        }

        public override void OnDeactivated(PSContextInfo contextInfo, ResourceDeactivatePostEventArgs e)
        {
            base.OnDeactivated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeactivated");
        }

        public override void OnDeactivating(PSContextInfo contextInfo, ResourceDeactivatePreEventArgs e)
        {
            base.OnDeactivating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeactivating");
        }

        public override void OnDeleted(PSContextInfo contextInfo, ResourceDeletePostEventArgs e)
        {
            base.OnDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleted");
        }

        public override void OnDeleting(PSContextInfo contextInfo, ResourceDeletePreEventArgs e)
        {
            base.OnDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleting");
        }

        public override void OnSetAuthorization(PSContextInfo contextInfo, ResourceAuthorizationPostEventArgs e)
        {
            base.OnSetAuthorization(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnSetAuthorization ");
        }

        public override void OnSettingAuthorization(PSContextInfo contextInfo, ResourceAuthorizationPreEventArgs e)
        {
            base.OnSettingAuthorization(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnSettingAuthorization");
        }
    }
    #endregion

    #region Rules Events
    public class RulesEventHandler : RulesEventReceiver
    {
        private const string CLASS_NAME = "RulesEventHandler";

        public override void OnCopied(PSContextInfo contextInfo, RulesPostCopyEventArgs e)
        {
            base.OnCopied(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCopied");
        }

        public override void OnCopying(PSContextInfo contextInfo, RulesPreCopyEventArgs e)
        {
            base.OnCopying(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCopying");
        }

        public override void OnCreated(PSContextInfo contextInfo, RulesPostCreateEventArgs e)
        {
            base.OnCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreated");
        }

        public override void OnCreating(PSContextInfo contextInfo, RulesPreCreateEventArgs e)
        {
            base.OnCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreating");
        }

        public override void OnDeleted(PSContextInfo contextInfo, RulesPostDeleteEventArgs e)
        {
            base.OnDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleted");
        }

        public override void OnDeleting(PSContextInfo contextInfo, RulesPreDeleteEventArgs e)
        {
            base.OnDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleting");
        }

        public override void OnProcessed(PSContextInfo contextInfo, RulesPostProcessEventArgs e)
        {
            base.OnProcessed(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnProcessed");
        }

        public override void OnProcessing(PSContextInfo contextInfo, RulesPreProcessEventArgs e)
        {
            base.OnProcessing(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnProcessing");
        }
    }
    #endregion

    #region Security Events
    public class SecurityEventHandler : SecurityEventReceiver
    {
        private const string CLASS_NAME = "SecurityEventHandler";

        public override void OnCategoryCreated(PSContextInfo contextInfo, CategoryCreatePostEventArgs e)
        {
            base.OnCategoryCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCategoryCreated");
        }

        public override void OnCategoryCreating(PSContextInfo contextInfo, CategoryCreatePreEventArgs e)
        {
            base.OnCategoryCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCategoryCreating");
        }

        public override void OnCategoryDeleted(PSContextInfo contextInfo, CategoryDeletePostEventArgs e)
        {
            base.OnCategoryDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCategoryDeleted");
        }

        public override void OnCategoryDeleting(PSContextInfo contextInfo, CategoryDeletePreEventArgs e)
        {
            base.OnCategoryDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCategoryDeleting");
        }

        public override void OnCategoryUpdated(PSContextInfo contextInfo, CategorySetPostEventArgs e)
        {
            base.OnCategoryUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCategoryUpdated");
        }

        public override void OnCategoryUpdating(PSContextInfo contextInfo, CategorySetPreEventArgs e)
        {
            base.OnCategoryUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCategoryUpdating");
        }

        public override void OnGroupCreated(PSContextInfo contextInfo, GroupCreatePostEventArgs e)
        {
            base.OnGroupCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnGroupCreated");
        }

        public override void OnGroupCreating(PSContextInfo contextInfo, GroupCreatePreEventArgs e)
        {
            base.OnGroupCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnGroupCreating");
        }

        public override void OnGroupDeleted(PSContextInfo contextInfo, GroupDeletePostEventArgs e)
        {
            base.OnGroupDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnGroupDeleted");
        }

        public override void OnGroupDeleting(PSContextInfo contextInfo, GroupDeletePreEventArgs e)
        {
            base.OnGroupDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnGroupDeleting");
        }

        public override void OnGroupUpdated(PSContextInfo contextInfo, GroupSetPostEventArgs e)
        {
            base.OnGroupUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnGroupUpdated");
        }

        public override void OnGroupUpdating(PSContextInfo contextInfo, GroupSetPreEventArgs e)
        {
            base.OnGroupUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnGroupUpdating");
        }

        public override void OnOrganizationalPermissionsUpdated(PSContextInfo contextInfo, OrganizationalPermissionsPostUpdateEventArgs e)
        {
            base.OnOrganizationalPermissionsUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnOrganizationPermissionsUpdated");
        }

        public override void OnOrganizationalPermissionsUpdating(PSContextInfo contextInfo, OrganizationalPermissionsPreUpdateEventArgs e)
        {
            base.OnOrganizationalPermissionsUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnOrganizationPermissionsUpdating");
        }

        public override void OnTemplateCreated(PSContextInfo contextInfo, TemplateCreatePostEventArgs e)
        {
            base.OnTemplateCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTemplateCreated");
        }

        public override void OnTemplateCreating(PSContextInfo contextInfo, TemplateCreatePreEventArgs e)
        {
            base.OnTemplateCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTemplateCreating");
        }

        public override void OnTemplateDeleted(PSContextInfo contextInfo, TemplateDeletePostEventArgs e)
        {
            base.OnTemplateDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTemplateDeleted");
        }

        public override void OnTemplateDeleting(PSContextInfo contextInfo, TemplateDeletePreEventArgs e)
        {
            base.OnTemplateDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTemplateDeleting");
        }

        public override void OnTemplateUpdated(PSContextInfo contextInfo, TemplateSetPostEventArgs e)
        {
            base.OnTemplateUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTemplateUpdated");
        }

        public override void OnTemplateUpdating(PSContextInfo contextInfo, TemplateSetPreEventArgs e)
        {
            base.OnTemplateUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTemplateUpdating");
        }
    }
    #endregion

    #region Statusing Events
    public class StatusingEventHandler : StatusingEventReceiver
    {
        private const string CLASS_NAME = "StatusingEventHandler";

        public override void OnApplied(PSContextInfo contextInfo, StatusingPostApplyEventArgs e)
        {
            base.OnApplied(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnApplied");
        }

        public override void OnApplying(PSContextInfo contextInfo, StatusingPreApplyEventArgs e)
        {
            base.OnApplying(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnApplying");
        }

        public override void OnApprovalsUpdated(PSContextInfo contextInfo, StatusUpdateApprovalsPostEventArgs e)
        {
            base.OnApprovalsUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnApprovalsUpdated");
        }

        public override void OnApprovalsUpdating(PSContextInfo contextInfo, StatusUpdateApprovalsPreEventArgs e)
        {
            base.OnApprovalsUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnApprovalsUpdating");
        }

        public override void OnAssignmentDelegated(PSContextInfo contextInfo, StatusDelegateTaskPostEventArgs e)
        {
            base.OnAssignmentDelegated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnAssignmentDelegated");
        }

        public override void OnAssignmentDelegating(PSContextInfo contextInfo, StatusDelegateTaskPreEventArgs e)
        {
            base.OnAssignmentDelegating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnAssignmentDelegating");
        }

        public override void OnAssignmentDeleted(PSContextInfo contextInfo, StatusDeleteTaskPostEventArgs e)
        {
            base.OnAssignmentDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnAssignmentDeleted");
        }

        public override void OnAssignmentDeleting(PSContextInfo contextInfo, StatusDeleteTaskPreEventArgs e)
        {
            base.OnAssignmentDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnAssignmentDeleting");
        }

        public override void OnHistoryDeleted(PSContextInfo contextInfo, StatusDeleteHistoryPostEventArgs e)
        {
            base.OnHistoryDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnHistoryDeleted");
        }

        public override void OnHistoryDeleting(PSContextInfo contextInfo, StatusDeleteHistoryPreEventArgs e)
        {
            base.OnHistoryDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnHistoryDeleting");
        }

        public override void OnStatusSubmitted(PSContextInfo contextInfo, StatusSubmitPostEventArgs e)
        {
            base.OnStatusSubmitted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnStatusSubmitted");
        }

        public override void OnStatusSubmiting(PSContextInfo contextInfo, StatusSubmitPreEventArgs e)
        {
            base.OnStatusSubmiting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnStatusSubmitting");
        }

        public override void OnStatusUpdated(PSContextInfo contextInfo, StatusUpdatePostEventArgs e)
        {
            base.OnStatusUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnStOnStatusUpdatedatusSubmitted");
        }

        public override void OnStatusUpdating(PSContextInfo contextInfo, StatusUpdatePreEventArgs e)
        {
            base.OnStatusUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnStatusUpdating");
        }

        public override void OnTaskCreated(PSContextInfo contextInfo, StatusCreateTaskPostEventArgs e)
        {
            base.OnTaskCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTaskCreated");
        }

        public override void OnTaskCreating(PSContextInfo contextInfo, StatusCreateTaskPreEventArgs e)
        {
            base.OnTaskCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnTaskCreating");
        }
    }
    #endregion

    #region Status Reports Events
    public class StatusReportsEventHandler : StatusReportsEventReceiver
    {
        private const string CLASS_NAME = "StatusReportsEventHandler";

        public override void OnRequestCreated(PSContextInfo contextInfo, StatusReportsPostRequestCreateEventArgs e)
        {
            base.OnRequestCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnRequestCreated");
        }

        public override void OnRequestCreating(PSContextInfo contextInfo, StatusReportsPreRequestCreateEventArgs e)
        {
            base.OnRequestCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnRequestCreating");
        }

        public override void OnRequestUpdated(PSContextInfo contextInfo, StatusReportsPostRequestUpdateEventArgs e)
        {
            base.OnRequestUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnRequestUpdated");
        }

        public override void OnRequestUpdating(PSContextInfo contextInfo, StatusReportsPreRequestUpdateEventArgs e)
        {
            base.OnRequestUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnRequestUpdating");
        }

        public override void OnResponseCreated(PSContextInfo contextInfo, StatusReportsPostResponseCreateEventArgs e)
        {
            base.OnResponseCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnResponseCreated");
        }

        public override void OnResponseCreating(PSContextInfo contextInfo, StatusReportsPreResponseCreateEventArgs e)
        {
            base.OnResponseCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnResponseCreating");
        }

        public override void OnResponseUpdated(PSContextInfo contextInfo, StatusReportsPostResponseUpdateEventArgs e)
        {
            base.OnResponseUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnResponseUpdated");
        }

        public override void OnResponseUpdating(PSContextInfo contextInfo, StatusReportsPreResponseUpdateEventArgs e)
        {
            base.OnResponseUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnResponseUpdating");
        }
    }
    #endregion

    #region Timesheet Events
    public class TimeSheetReportsEventHandler : TimesheetEventReceiver
    {
        private const string CLASS_NAME = "TimeSheetEventHandler";

        public override void OnCreated(PSContextInfo contextInfo, TimesheetPostEventArgs e)
        {
            base.OnCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreated");
        }

        public override void OnCreating(PSContextInfo contextInfo, TimesheetPreCreateEventArgs e)
        {
            base.OnCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreating");
        }

        public override void OnDeleted(PSContextInfo contextInfo, TimesheetPostEventArgs e)
        {
            base.OnDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleted");
        }

        public override void OnDeleting(PSContextInfo contextInfo, TimesheetPreDeleteEventArgs e)
        {
            base.OnDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleting");
        }

        public override void OnLineApproved(PSContextInfo contextInfo, TimesheetLinePostApproveEventArgs e)
        {
            base.OnLineApproved(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnLineApproved");
        }

        public override void OnLineApproving(PSContextInfo contextInfo, TimesheetLinePreApproveEventArgs e)
        {
            base.OnLineApproving(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnLineApproving");
        }

        public override void OnRecalled(PSContextInfo contextInfo, TimesheetPostEventArgs e)
        {
            base.OnRecalled(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnRecalled");
        }

        public override void OnRecalling(PSContextInfo contextInfo, TimesheetPreRecallEventArgs e)
        {
            base.OnRecalling(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnRecalling");
        }

        public override void OnReviewed(PSContextInfo contextInfo, TimesheetPostEventArgs e)
        {
            base.OnReviewed(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnReviewed");
        }

        public override void OnReviewing(PSContextInfo contextInfo, TimesheetPreReviewEventArgs e)
        {
            base.OnReviewing(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnReviewing");
        }

        public override void OnSubmitted(PSContextInfo contextInfo, TimesheetPostEventArgs e)
        {
            base.OnSubmitted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnSubmitted");
        }

        public override void OnSubmitting(PSContextInfo contextInfo, TimesheetPreSubmitEventArgs e)
        {
            base.OnSubmitting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnSubmitting");
        }

        public override void OnUpdated(PSContextInfo contextInfo, TimesheetPostEventArgs e)
        {
            base.OnUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnUpdated");
        }

        public override void OnUpdating(PSContextInfo contextInfo, TimesheetPreUpdateEventArgs e)
        {
            base.OnUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnUpdating");
        }
    }
    #endregion

    #region Project Events
    public class ProjectEventHandler : ProjectEventReceiver
    {
        private const string CLASS_NAME = "ProjectEventHandler";

        public override void OnAdded(PSContextInfo contextInfo, ProjectPostUpdatedEventArgs e)
        {
            base.OnAdded(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnAdded");
        }

        public override void OnAdding(PSContextInfo contextInfo, ProjectPreEventArgs e)
        {
            base.OnAdding(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnAdding");
        }

        public override void OnCheckIn(PSContextInfo contextInfo, ProjectPostEventArgs e)
        {
            base.OnCheckIn(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCheckIn");
        }

        public override void OnCreated(PSContextInfo contextInfo, ProjectPostEventArgs e)
        {
            base.OnCreated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreated");
        }

        public override void OnCreating(PSContextInfo contextInfo, ProjectPreEventArgs e)
        {
            base.OnCreating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnCreating");
        }

        public override void OnDeleted(PSContextInfo contextInfo, ProjectPostEventArgs e)
        {
            base.OnDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleted");
        }

        public override void OnDeleting(PSContextInfo contextInfo, ProjectPreEventArgs e)
        {
            base.OnDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnDeleting");
        }

        public override void OnEntitiesDeleted(PSContextInfo contextInfo, ProjectPostEntitiesDeletedEventArgs e)
        {
            base.OnEntitiesDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnEntitiesDeleted");
        }

        public override void OnEntitiesDeleting(PSContextInfo contextInfo, ProjectPreEntitiesDeletingEventArgs e)
        {
            base.OnEntitiesDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnEntitiesDeleting");
        }

        public override void OnActivityUpgraded(PSContextInfo contextInfo, ActivityUpgradedEventArgs e)
        {
            base.OnActivityUpgraded(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnActivityUpgraded");
        }

        public override void OnActivityUpgrading(PSContextInfo contextInfo, ActivityUpgradingEventArgs e)
        {
            base.OnActivityUpgrading(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnActivityUpgrading");
        }

        public override void OnPublished(PSContextInfo contextInfo, ProjectPostPublishEventArgs e)
        {
            base.OnPublished(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnPublished");
        }

        public override void OnPublishing(PSContextInfo contextInfo, ProjectPrePublishEventArgs e)
        {
            base.OnPublishing(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnPublishing");
        }

        public override void OnUpdated(PSContextInfo contextInfo, ProjectPostUpdatedEventArgs e)
        {
            base.OnUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnUpdated");
        }

        public override void OnUpdating(PSContextInfo contextInfo, ProjectPreEventArgs e)
        {
            base.OnUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnUpdating");
        }

        public override void OnSaved(PSContextInfo contextInfo, ProjectPostEventArgs e)
        {
            base.OnSaved(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnSaved");
        }

        public override void OnSaveFailed(PSContextInfo contextInfo, ProjectPostEventArgs e)
        {
            base.OnSaveFailed(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnSaveFailed");
        }

        public override void OnWssWorkspaceAddressDeleted(PSContextInfo contextInfo, WssWorkspaceAddressDeletedEventArgs e)
        {
            base.OnWssWorkspaceAddressDeleted(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnWssWorkspaceAddressDeleted");
        }

        public override void OnWssWorkspaceAddressDeleting(PSContextInfo contextInfo, WssWorkspaceAddressDeletingEventArgs e)
        {
            base.OnWssWorkspaceAddressDeleting(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnWssWorkspaceAddressDeleting");
        }

        public override void OnWssWorkspaceAddressUpdated(PSContextInfo contextInfo, WssWorkspaceAddressUpdatedEventArgs e)
        {
            base.OnWssWorkspaceAddressUpdated(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnWssWorkspaceAddressUpdated");
        }

        public override void OnWssWorkspaceAddressUpdating(PSContextInfo contextInfo, WssWorkspaceAddressUpdatingEventArgs e)
        {
            base.OnWssWorkspaceAddressUpdating(contextInfo, e);

            Helper.WriteOutput(contextInfo, e, CLASS_NAME, "OnWssWorkspaceAddressUpdating");
        }
    }
    #endregion

    #region Output Methods
    public class Helper
    {
        static internal void WriteOutput(object contextInfo, object eventArgs, string className, string eventName)
        {
            // Create an EventLog instance and assign its source.
            EventLog myLog = new EventLog();
            myLog.Source = "PSI Event Logger";

            try
            {
                string logEntry = "Event=" + className + "." + eventName + "\n";

                logEntry = logEntry + BuildString(contextInfo);
                logEntry = logEntry + BuildString(eventArgs);

                myLog.WriteEntry(logEntry, EventLogEntryType.Information);
            }
            catch (Exception err)
            {
                myLog.WriteEntry("Error in PSI event logger, " + className + "." + eventName + " event.  " + err.Message, EventLogEntryType.Information);
            }
        }

        static internal string BuildString(object obj)
        {
            string logEntry = "";

            const BindingFlags bf = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic;
            foreach (PropertyInfo pi in obj.GetType().GetProperties(bf))
            {
                if (pi.GetValue(obj, null) == null)
                {
                    logEntry = logEntry + pi.Name + "=null\n";
                }
                else
                {
                    logEntry = logEntry + pi.Name + "=" + pi.GetValue(obj, null).ToString() + "\n";
                }
            }
            return logEntry;
        }
    }
    #endregion
}
